********************************************************************************
* Packages that need to be installed
********************************************************************************
** ssc install reghdfe
** ssc install cmogram
** Install DCDensity from https://eml.berkeley.edu/~jmccrary/DCdensity/

********************************************************************************
* Load data 
********************************************************************************
use "L:\Forschungsprojekte\LB_ExComp\10_Data_ready\rcfs_lss_replication_data.dta", clear

********************************************************************************
* Generate output
********************************************************************************
* Figure 1
reghdfe ln_payratio dummy_ia_* ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy)
estimates store did_timedynamics

coefplot did_timedynamics, baselevels keep(dummy_ia_*) yline(0) ytitle("coefficient estimate") vertical coeflabel(dummy_ia_2005 = 2005 dummy_ia_2006 = 2006 dummy_ia_2007 = 2007 dummy_ia_2008 = 2008 dummy_ia_2009 = 2009 dummy_ia_2010 = 2010 dummy_ia_2011 = 2011 dummy_ia_2012 = 2012 dummy_ia_2013 = 2013) levels(90) addplot(scatteri -0.2 4.5 0.3 4.5, recast(line) lcolor(gray))

* Figure 2
capture drop Xj Yj r0 fhat se_fhat Yj_new
DCdensity emp_de_2008 if fy==2008 & emp_de_2008>1000 & emp_de_2008<3000, breakpoint(2000) generate(Xj Yj  r0 fhat se_fhat)  
local breakpoint 2000
local cellmpname Xj
local cellvalname Yj_new
local evalname r0
local cellsmname fhat
local cellsmsename se_fhat
generate Yj_new = Yj
local lowerbound 1400		
local upperbound 2600

tempvar hi
quietly gen `hi' = `cellsmname' + 1.96*`cellsmsename'
tempvar lo
quietly gen `lo' = `cellsmname' - 1.96*`cellsmsename'
gr twoway (scatter `cellvalname' `cellmpname' if  `cellmpname' >=`lowerbound' & `cellmpname' <=`upperbound', msymbol(circle_hollow) mcolor(gray))             ///
  (line `cellsmname' `evalname' if `evalname' < `breakpoint' & `evalname'<=`upperbound' & `evalname'>=`lowerbound', lcolor(black) lwidth(medthick))   ///
  (line `cellsmname' `evalname' if `evalname' > `breakpoint' & `evalname'<=`upperbound' & `evalname'>=`lowerbound', lcolor(black) lwidth(medthick))   ///
  (line `hi' `evalname' if `evalname' < `breakpoint' & `evalname'<=`upperbound' & `evalname'>=`lowerbound', lcolor(black) lwidth(vthin))              ///
  (line `lo' `evalname' if `evalname' < `breakpoint' & `evalname'<=`upperbound' & `evalname'>=`lowerbound', lcolor(black) lwidth(vthin))              ///
  (line `hi' `evalname' if `evalname' > `breakpoint' & `evalname'<=`upperbound' & `evalname'>=`lowerbound', lcolor(black) lwidth(vthin))              ///
  (line `lo' `evalname' if `evalname' > `breakpoint' & `evalname'<=`upperbound' & `evalname'>=`lowerbound', lcolor(black) lwidth(vthin)),             ///
  xline(`breakpoint', lcolor(black)) legend(off) ylabel(,angle(0)) ytitle("") xtitle("") xlabel(, format(%12.0fc))

* Figure 3
cmogram delta_abs_payratio_mean emp_de_2008 if sample_rd==1, cut(2000) scatter line(2000) lfitci histopts(bin(5)) lfitopts(level(90)) graphopts(ylabel(-5 -2.5 0 2.5 5 7.5 10) ytitle("") xtitle(""))   

* Table 1: Descriptive statistics
tabstat d_2000_08 te ln_te emp_domestic emp_de_2008 d_post2 payratio ln_payratio execcomp_mio ln_execcomp wages_total_tsd ln_wages_total   layoff_te ta_mio ln_ta profitability leverage_ta tarif_total_coveredfirms if sample_obs_no2009==1,columns(stats) stats(N mean p25 p50 p75 sd)

* Table 2: Emplyoee representation on compensation committees before the legal change
** Panel A
count if com_08_wedge == 1 & sample_firm==1 & fy==2008
count if com_08_wedge == 0 & sample_firm==1 & fy==2008
count if com_08_wedge == . & sample_firm==1 & fy==2008

count if com_08_wedge == 1 & sample_firm==1 & fy==2008 & d_2000_08==0
count if com_08_wedge == 0 & sample_firm==1 & fy==2008 & d_2000_08==0
count if com_08_wedge == . & sample_firm==1 & fy==2008 & d_2000_08==0

count if com_08_wedge == 1 & sample_firm==1 & fy==2008 & d_2000_08==1
count if com_08_wedge == 0 & sample_firm==1 & fy==2008 & d_2000_08==1
count if com_08_wedge == . & sample_firm==1 & fy==2008 & d_2000_08==1

** Panel B
reghdfe com_08_wedge d_2000_08 													if sample_firm==1 & fy==2008, cluster(random_id) noabsorb
reghdfe com_08_wedge d_2000_08 ln_te profitability leverage_ta  				if sample_firm==1 & fy==2008, cluster(random_id) noabsorb 
reghdfe com_08_wedge d_2000_08 ln_te profitability leverage_ta  				if sample_firm==1 & fy==2008, cluster(random_id) absorb(ind_ff5) 

* Table 3: Pay ratio around the 2009 law change
reghdfe ln_payratio d_2000_08##d_post2 											if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta 			if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio dummy_ia_* 													if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio dummy_ia_* ln_te profitability leverage_ta 					if sample_obs==1, cluster(random_id) absorb(random_id fy)

* Table 4: Matched samples
** Panel A 
reghdfe ln_payratio d_2000_08##d_post2    		 								if sample_obs==1 & d_match_lnte_c50==1, cluster(random_id) absorb(random_id fy)
gen sample_match_lnte = e(sample)

reghdfe ln_payratio d_2000_08##d_post2 ln_te  profitability leverage_ta			if sample_obs==1 & d_match_lnte_c50==1, cluster(random_id) absorb(random_id fy)

reghdfe ln_payratio d_2000_08##d_post2    		 								if sample_obs==1 & d_match_lnta_c50==1, cluster(random_id) absorb(random_id fy)
gen sample_match_lnta = e(sample)

reghdfe ln_payratio d_2000_08##d_post2 ln_te  profitability leverage_ta			if sample_obs==1 & d_match_lnta_c50==1, cluster(random_id) absorb(random_id fy)

reghdfe ln_payratio d_2000_08##d_post2    		 								if sample_obs==1 & d_match_ctrs_c50==1, cluster(random_id) absorb(random_id fy)
gen sample_match_ctrs = e(sample)

reghdfe ln_payratio d_2000_08##d_post2 ln_te  profitability leverage_ta			if sample_obs==1 & d_match_ctrs_c50==1, cluster(random_id) absorb(random_id fy)

** Panel B
reg w_te d_2000_08 				if sample_match_lnte==1 & fy==2008, cluster(random_id) 
reg w_ta_mio d_2000_08 			if sample_match_lnte==1 & fy==2008, cluster(random_id) 
reg profitability d_2000_08 	if sample_match_lnte==1 & fy==2008, cluster(random_id) 
reg leverage_ta d_2000_08 		if sample_match_lnte==1 & fy==2008, cluster(random_id) 

reg w_te d_2000_08 				if sample_match_lnta==1 & fy==2008, cluster(random_id) 
reg w_ta_mio d_2000_08 			if sample_match_lnta==1 & fy==2008, cluster(random_id) 
reg profitability d_2000_08 	if sample_match_lnta==1 & fy==2008, cluster(random_id) 
reg leverage_ta d_2000_08 		if sample_match_lnta==1 & fy==2008, cluster(random_id) 

reg w_te d_2000_08 				if sample_match_ctrs==1 & fy==2008, cluster(random_id) 
reg w_ta_mio d_2000_08 			if sample_match_ctrs==1 & fy==2008, cluster(random_id) 
reg profitability d_2000_08 	if sample_match_ctrs==1 & fy==2008, cluster(random_id) 
reg leverage_ta d_2000_08 		if sample_match_ctrs==1 & fy==2008, cluster(random_id) 

* Table 5: Other aspects of the 2009 law
** Panel A 
reghdfe ln_payratio d_2000_08##d_post2 											if sample_obs==1 & var_frac_tercile==1, cluster(random_id) absorb(random_id fy)

reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta  		if sample_obs==1 & var_frac_tercile==1, cluster(random_id) absorb(random_id fy)

reghdfe ln_payratio d_2000_08##d_post2 											if sample_obs==1 & profit_tercile==3, cluster(random_id) absorb(random_id fy)

reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta  		if sample_obs==1 & profit_tercile==3, cluster(random_id) absorb(random_id fy)

** Panel B
reghdfe var_frac_08 d_2000_08 c_emp_de_2008 				 					if sample_rd==1, cluster(random_id) noabsorb
reghdfe var_frac_08 d_2000_08 c.c_emp_de_2008##c.d_2000_08    					if sample_rd==1, cluster(random_id) absorb(ind_ff5)
reghdfe profitability_08 d_2000_08 c_emp_de_2008				 				if sample_rd==1, cluster(random_id) noabsorb
reghdfe profitability_08 d_2000_08 c.c_emp_de_2008##c.d_2000_08  				if sample_rd==1, cluster(random_id) absorb(ind_ff5)

* Table 6: Less affected firms as placebo test
reghdfe ln_payratio d_2000_08##d_post2 											if sample_noper==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta 			if sample_noper==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 											if sample_nostockcorp==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta  		if sample_nostockcorp==1, cluster(random_id) absorb(random_id fy)

* Table 7: Effect of the legal change on executiv compensation
reghdfe ln_execcomp d_2000_08##d_post2											if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_execcomp d_2000_08##d_post2  ln_te profitability leverage_ta 		if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe execcomp_mio d_2000_08##d_post2 										if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe execcomp_mio d_2000_08##d_post2  ln_te profitability leverage_ta		if sample_obs==1, cluster(random_id) absorb(random_id fy)

* Table 8: Profitability and variable pay
** Panel A
reghdfe profitability d_2000_08##d_post2 										if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe profitability d_2000_08##d_post2 ln_te  leverage_ta  					if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe profitability_ebitda d_2000_08##d_post2 								if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe profitability_ebitda d_2000_08##d_post2 ln_te  leverage_ta  			if sample_obs==1, cluster(random_id) absorb(random_id fy)

** Panel B
reghdfe var_frac d_2000_08##d_post2 											if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe var_frac d_2000_08##d_post2 ln_te  leverage_ta profitability  			if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_execcomp d_2000_08##d_post2##c.profitability 	  					if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_execcomp d_2000_08##d_post2##c.profitability ln_te  leverage_ta   	if sample_obs==1, cluster(random_id) absorb(random_id fy)

* Table 9: Executive Turnover
** Turnover
reghdfe to_change_rel d_2000_08##d_post2 										if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe to_change_rel d_2000_08##d_post2 ln_te profitability leverage_ta  		if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe to_change_rel d_2000_08##d_post2##c.c_profitability   					if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe to_change_rel d_2000_08##d_post2##c.c_profitability  ln_te  leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy)

* Table 10: Employee wages around the 2009 legal change
reghdfe ln_wages_total  d_2000_08##d_post2##c.tarif_total_coveredfirms 			if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_wages_total d_2000_08##d_post2##c.tarif_total_coveredfirms ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe wages_total_tsd d_2000_08##d_post2##c.tarif_total_coveredfirms 			if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe wages_total_tsd d_2000_08##d_post2##c.tarif_total_coveredfirms ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy)
 
* Table 11: Employee layoffs 
** Panel A
reghdfe layoff_te d_2000_08##d_post2 if sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te if sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 if d_match_ctrs_c50==1 & sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)

** Panel B
reghdfe layoff_te d_2000_08##d_post2  ln_te profitability leverage_ta if sample_obs==1 & profit_half_preperiod==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
 
reghdfe layoff_te d_2000_08##d_post2  ln_te profitability leverage_ta if sample_obs==1 & profit_half_preperiod==2, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
 
reghdfe layoff_te d_2000_08##d_post2  ln_te profitability leverage_ta if sample_obs==1 & frac_de_08 >=0.5 & frac_de_08!=., cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
 
reghdfe layoff_te d_2000_08##d_post2  ln_te profitability leverage_ta if sample_obs==1 & frac_de_08 <0.5 & frac_de_08!=., cluster(random_id) absorb(random_id fy c.frac_de_08##fy)

* Figure IA.1
cmogram delta_abs_payratio_mean  emp_de_2008 if sample_rd==1, count cut(2000) scatter line(2000)  histopts(bin(5)) lfitopts(level(90)) graphopts(ylabel(0 5 10 15 20) ytitle("") xtitle("")) 

* Figure IA.2
hist payratio if sample_obs==1, bin(25) xtitle("")
hist ln_payratio if sample_obs==1, bin(25) xtitle("")
hist delta_abs_payratio_mean if sample_obs==1, bin(25) xtitle("")

* Table IA.1: Compliance with the PER requirement and 2SLS
reghdfe d_per_08 d_2000_08 									if sample_firm==1 & fy==2008, cluster(random_id) noabsorb
reghdfe d_per_08 d_2000_08 ln_te profitability leverage_ta			if sample_firm==1 & fy==2008, cluster(random_id) noabsorb
ivreghdfe ln_payratio (d_per_08_d_post2=d_2000_08_d_post2) 	if sample_obs==1, cluster(random_id) absorb(random_id fy)
ivreghdfe ln_payratio (d_per_08_d_post2=d_2000_08_d_post2) ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy)

* Table IA.2: Robustness of pay ratio results
** Panel A
reghdfe ln_payratio d_2000_08##d_post2 ln_de if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 ln_de profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 ln_ta if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 ln_ta profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy)

** Panel B
reghdfe ln_payratio d_2000_08##d_post2 if sample_obs==1 & fy>=2006 & fy<=2012, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1 & fy>=2006 & fy<=2012, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 if sample_obs==1 & fy>=2007 & fy<=2011, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1 & fy>=2007 & fy<=2011, cluster(random_id) absorb(random_id fy)

** Panel C
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy##ind_ff5)
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy##ind_ff12)
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy##ind_ff17)
reghdfe ln_payratio d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy##ind_ff30)

* Table IA.3: Descriptive statistics of firms above/below the PER threshold
** Panel A
tabstat d_2000_08 te ln_te emp_domestic emp_de_2008 d_post2 payratio ln_payratio execcomp_mio ln_execcomp wages_total_tsd ln_wages_total   layoff_te ta_mio ln_ta profitability leverage_ta tarif_total_coveredfirms if sample_obs_no2009==1 & d_2000_08==0,columns(stats) stats(N mean p25 p50 p75 sd)

** Panel B
tabstat d_2000_08 te ln_te emp_domestic emp_de_2008 d_post2 payratio ln_payratio execcomp_mio ln_execcomp wages_total_tsd ln_wages_total   layoff_te ta_mio ln_ta profitability leverage_ta tarif_total_coveredfirms if sample_obs_no2009==1 & d_2000_08==1,columns(stats) stats(N mean p25 p50 p75 sd)

* Table IA.4: Controlling for responses by different firm characteristics in Drandom_id
reghdfe ln_payratio d_2000_08##d_post2 c.ln_te##d_post2 if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 c.(ln_te profitability leverage_ta)##d_post2 if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 c.ln_te##d_2000_08 if sample_obs==1, cluster(random_id) absorb(random_id fy)
reghdfe ln_payratio d_2000_08##d_post2 c.(ln_te profitability leverage_ta)##d_2000_08 if sample_obs==1, cluster(random_id) absorb(random_id fy)

* Table IA.5: Discontinuity-in-differences results
** Panel A
reghdfe delta_abs_payratio_mean  d_2000_08  c.c_emp_de_2008 if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_payratio_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_payratio_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_payratio_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta if sample_rd==1, cluster(random_id) absorb(ind_ff5)

** Panel B
reghdfe delta_abs_execcomp_mio_mean  d_2000_08  c.c_emp_de_2008 if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_execcomp_mio_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_execcomp_mio_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_execcomp_mio_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta if sample_rd==1, cluster(random_id) absorb(ind_ff5)

** Panel C
reghdfe delta_abs_to_change_rel_mean  d_2000_08  c.c_emp_de_2008 if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_to_change_rel_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_to_change_rel_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_to_change_rel_mean  d_2000_08  c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta if sample_rd==1, cluster(random_id) absorb(ind_ff5)
 
** Panel D
reghdfe delta_abs_wages_total_tsd_mean  d_2000_08##c.tarif_total_coveredfirms  c.c_emp_de_2008##c.tarif_total_coveredfirms if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_wages_total_tsd_mean  d_2000_08##c.tarif_total_coveredfirms  c.c_emp_de_2008##c.tarif_total_coveredfirms c.c_emp_de_2008##c.d_2000_08 if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_wages_total_tsd_mean  d_2000_08##c.tarif_total_coveredfirms  c.c_emp_de_2008##c.tarif_total_coveredfirms c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_abs_wages_total_tsd_mean  d_2000_08##c.tarif_total_coveredfirms  c.c_emp_de_2008##c.tarif_total_coveredfirms c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta if sample_rd==1, cluster(random_id) absorb(ind_ff5)

** Panel E
reghdfe delta_layoffs  d_2000_08  c.c_emp_de_2008 if sample_rd==1, cluster(random_id) noabsorb
reghdfe delta_layoffs  d_2000_08  c.c_emp_de_2008##c.d_2000_08 ln_te profitability leverage_ta frac_de_08 if sample_rd==1, cluster(random_id) absorb(ind_ff5)
reghdfe delta_layoffs  d_2000_08  c.c_emp_de_2008 if sample_rd==1 & profit_half_preperiod==1, cluster(random_id) noabsorb
reghdfe delta_layoffs  d_2000_08  c.c_emp_de_2008 if sample_rd==1 & profit_half_preperiod==2, cluster(random_id) noabsorb

* Table IA.6: Employee layoff robustness
** Panel A
reghdfe layoff_te d_2000_08##d_post2 if sample_obs==1 & var_frac_tercile==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1 & var_frac_tercile==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 if sample_obs==1 & profit_tercile==3, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1 & profit_tercile==3, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)

** Panel B
reghdfe layoff_te d_2000_08##d_post2 if sample_noper==1 & payratio!=., cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_noper==1 & payratio!=., cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 if sample_nostockcorp==1 & payratio!=., cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_nostockcorp==1 & payratio!=., cluster(random_id) absorb(random_id fy c.frac_de_08##fy)

** Panel C
reghdfe layoff_te d_2000_08##d_post2 ln_de if sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_de profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_ta if sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_ta profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)

** Panel D
reghdfe layoff_te d_2000_08##d_post2 if fy>=2006 & fy<=2012 & sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if fy>=2006 & fy<=2012 & sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 if fy>=2007 & fy<=2011 & sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy )
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if fy>=2007 & fy<=2011 & sample_obs==1, cluster(random_id) absorb(random_id fy c.frac_de_08##fy)
 
** Panel E
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy##ind_ff5 c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy##ind_ff12 c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy##ind_ff17 c.frac_de_08##fy)
reghdfe layoff_te d_2000_08##d_post2 ln_te profitability leverage_ta if sample_obs==1, cluster(random_id) absorb(random_id fy##ind_ff30 c.frac_de_08##fy)